<template>
	<view class="setting-container" :style="{height: `${windowHeight}px`}">
		<!-- 	<uni-card spacing="0" padding="0">
			<u-cell-group :border="false">
				<u-cell :isLink="true" @click="handleToPwd">
					<u-icon slot="icon" name="lock-fill" color="#007AFF"></u-icon>
					<u--text slot="title" text="修改密码"></u--text>
				</u-cell>
			</u-cell-group>
		</uni-card> -->
		<view class="cu-list menu">
			<view class="cu-item item-box">
				<view class="content text-center" @click="handleLogout">
					<text class="text-black">退出登录</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				pageFontSize: uni.getStorageSync('pageFontSize') ? uni.getStorageSync('pageFontSize') : 18,
				windowHeight: uni.getSystemInfoSync().windowHeight,
			}
		},
		methods: {
			handleToPwd() {
				uni.navigateTo({
					url: '/pages/personalCenter/pwd/index'
				})
			},
			handleLogout() {
				uni.showModal({
					title: '提示',
					content: '您确定要退出登录吗？',
					success(res) {
						if (res.confirm) {
							uni.removeStorageSync('userInfo');
							uni.removeStorageSync('token')
							uni.removeStorageSync('phone')
							uni.removeStorageSync('openid')
							uni.reLaunch({
								url: '/pages/login/login'
							})
						}
					}
				})

			}
		}
	}
</script>

<style lang="scss" scoped>
	.page {
		background-color: #f8f8f8;
	}

	.item-box {
		background-color: #FFFFFF;
		margin: 30rpx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		padding: 10rpx;
		border-radius: 8rpx;
		color: #303133;
		font-size: 32rpx;
	}
</style>